home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk15 / qrt / docs / cfg.doc < prev    next >
Text File  |  1995-03-18  |  8KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.         
  8.                    Context Free Grammar for QRT Input Language
  9.         
  10.         
  11.            Notes: '(' and ')' are non-terminal symbols
  12.                   (  and  )   are CFG parens
  13.                   +           is one or more than one
  14.         
  15.                   o lower case strings in grammar are non-terminals
  16.                   o input language is not case sensitive
  17.                   o <WHITE_SPACE> = blank | newline
  18.                   o args can be separated by optional ',' or ';'
  19.                   o '=' can separate argument name from value
  20.                         or string.
  21.         
  22.         
  23.         
  24.           <WORLD>         = <INSTANCE_DEFS> ( <OBJECT> | <ATTRIBUTE> )+
  25.         
  26.           <INSTANCE_DEFS> = begin_instances <OBJECT>+ end_instances
  27.         
  28.           <OBJECT>        = <PRIMITIVE>+ |
  29.                             ( name <STRING> | <EMPTY> )
  30.                                begin_bbox <OBJECT> end_bbox
  31.         
  32.           <PRIMITIVE>     = <SPHERE> |
  33.                             <PARALLELOGRAM> |
  34.                             <RING> |
  35.                             <QUADRATIC> |
  36.                             <INSTANCE_OF>
  37.         
  38.           <ATTRIBUTE>     = <SKY>               |
  39.                             foc_length <NUMBER> |
  40.                             first_scan <NUMBER> |
  41.                             last_scan  <NUMBER> |
  42.                             <DEFAULT>           |
  43.                             file_name  <STRING> |
  44.                             <LAMP>              |
  45.                             <PATTERN>           |
  46.                             <OBSERVER>
  47.         
  48.           <SPHERE>        = sphere '(' <SPHERE_DEF>+ ')'
  49.         
  50.           <SPHERE_DEF>    = <POSITION>    |
  51.                             name <STRING> |
  52.                             radius  <NUM> |
  53.                             <CINFO>       |
  54.                             pattern <STRING>
  55.         
  56.           <PARALLELOGRAM> = parallelogram ( <PAR_DEF>+ )
  57.         
  58.  
  59.  
  60.         QRT Ray Tracer               Page 1          Context Free Grammar
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           <PAR_DEF>       = <POSITION>     |
  74.                             name  <STRING> |
  75.                             v1    <VECTOR> |
  76.                             vect1 <VECTOR> |
  77.                             v2    <VECTOR> |
  78.                             vect2 <VECTOR> |
  79.                             <CINFO>        |
  80.                             pattern <STRING>
  81.         
  82.           <TRIANGLE>      = triangle ( <TRIANGLE_DEF>+ )
  83.         
  84.           <TRIANGLE_DEF>  = <POSITION>     |
  85.                             name  <STRING> |
  86.                             v1    <VECTOR> |
  87.                             vect1 <VECTOR> |
  88.                             v2    <VECTOR> |
  89.                             vect2 <VECTOR> |
  90.                             <CINFO>        |
  91.                             pattern <STRING>
  92.         
  93.           <RING>          = ring '(' <RING_REF>+ ')'
  94.         
  95.           <RING_DEF>      = <POSITION>     |
  96.                             name  <STRING> |
  97.                             v1    <VECTOR> |
  98.                             vect1 <VECTOR> |
  99.                             v2    <VECTOR> |
  100.                             vect2 <VECTOR> |
  101.                             rad_1   <NUM>  |
  102.                             rad_2   <NUM>  |
  103.                             <CINFO>        |
  104.                             pattern <STRING>
  105.         
  106.           <QUADRATIC>     = quadratic '(' <QUAD_DEF>+ ')'
  107.         
  108.           <QUAD_DEF>      = <POSITION>    |
  109.                             name <STRING> |
  110.                             a       <NUM> |
  111.                             b       <NUM> |
  112.                             c       <NUM> |
  113.                             d       <NUM> |
  114.                             xmin    <NUM> |
  115.                             xmax    <NUM> |
  116.                             ymin    <NUM> |
  117.                             ymax    <NUM> |
  118.                             zmin    <NUM> |
  119.                             zmax    <NUM> |
  120.                             dir  <VECTOR> |
  121.                             <CINFO>       |
  122.                             pattern <STRING>
  123.         
  124.  
  125.  
  126.         QRT Ray Tracer               Page 2          Context Free Grammar
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           <INSTANCE_OF>   = instance_of ( <INSTANCE>+ )
  140.         
  141.           <INSTANCE>      = name <STRING>       |
  142.                             <POSITION>          |
  143.                             scale    = <VECTOR>
  144.         
  145.           <SKY>           = sky '(' <SKY_DEF>+ ')'
  146.         
  147.           <SKY_DEF>       = zenith <COLOR_TRIPLE> |
  148.                             horiz  <COLOR_TRIPLE>
  149.         
  150.           <DEFAULT>       = default '(' <DEFAULT_DEF>+ ')'
  151.         
  152.           <DEFAULT_DEF>   = <CINFO>   |
  153.                             no_shadow |
  154.                             no_lamp
  155.         
  156.           <LAMP>          = lamp '(' <LAMP_DEF>+ ')'
  157.         
  158.           <LAMP_DEF>      = <POSITION>    |
  159.                             radius  <NUM> |
  160.                             dist    <NUM> |
  161.                             <AMB>+
  162.         
  163.           <OBSERVER>      = observer '(' <OBS_DEF>+ ')'
  164.         
  165.           <OBS_DEF>       = <POSITION>      |
  166.                             lookat <VECTOR> |
  167.                             up     <VECTOR>
  168.         
  169.           <PATTERN>       = pattern '(' <PATTERN_DEF>+ ')'
  170.         
  171.           <PATTERN_DEF>   = x_size   <NUM>    |
  172.                             y_size   <NUM>    |
  173.                             name     <STRING> |
  174.                             '(' <SUB_PATTERN>+ ')'
  175.         
  176.           <SUB_PATTERN>   = RECTANGLE <RECTANGLE_PAT> |
  177.                             CIRCLE    <CIRCLE_PAT>
  178.         
  179.           <RECTANGLE_PAT> = start_x   <NUM> |
  180.                             stary_y   <NUM> |
  181.                             start_z   <NUM> |
  182.                             end_x     <NUM> |
  183.                             end_y     <NUM> |
  184.                             end_z     <NUM> |
  185.                             <CINFO>
  186.         
  187.           <CIRCLE_PAT>    = radius    <NUM>
  188.                             <CINFO>
  189.         
  190.  
  191.  
  192.         QRT Ray Tracer               Page 3          Context Free Grammar
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           <POSITION>      = LOC      <VECTOR> |
  206.                             POS      <VECTOR> |
  207.                             LOCATION <VECTOR> |
  208.                             POSITION <VECTOR>
  209.         
  210.           <CINFO>         = <AMB>          |
  211.                             <DIFF>         |
  212.                             <TRANS>        |
  213.                             <MIRROR>       |
  214.                             fuzz     <INT> |
  215.                             index    <NUM> |
  216.                             dither   <INT> |
  217.                             sreflect <NUM> |
  218.                             reflect  <NUM>
  219.         
  220.           <AMB>           = amb    <COLOR_TRIPLE>
  221.         
  222.           <DIFF>          = diff   <COLOR_TRIPLE>
  223.         
  224.           <TRANS>         = trans  <COLOR_TRIPLE>
  225.         
  226.           <MIRROR>        = mirror <COLOR_TRIPLE>
  227.         
  228.           <COLOR_TRIPLE>  = '(' <NUM>, <NUM>, <NUM> ')'
  229.         
  230.           <VECTOR>        = '(' <NUM>, <NUM>, <NUM> ')'
  231.         
  232.           <NUM>           =   <INT> |
  233.                             - <INT> |
  234.                               <INT> . <INT> |
  235.                             - <INT> . <INT>
  236.         
  237.           <INT>           = <DIGIT>+
  238.         
  239.           <DIGIT>         = 0|1|2|3|4|5|6|7|8|9
  240.         
  241.           <STRING>        = ( <ALPHA> | <DIGIT> )+
  242.         
  243.           <ALPHA>         = a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|
  244.                             q|r|s|t|u|v|w|x|y|z|_|*|-
  245.         
  246.           <EMPTY>         =
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.         QRT Ray Tracer               Page 4          Context Free Grammar
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.